<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>企业微信信息化平台</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/index.css}">
    <style>
        .layui-table-cell {
            font-size: 14px;
            padding: 0 5px;
            height: auto;
            overflow: visible;
            text-overflow: inherit;
            white-space: normal;
            word-break: break-all;
        }
    </style>
</head>
<body>
<ul class="layui-nav layui-nav-tree " lay-filter="demo">
    <li class="layui-nav-item layui-nav-itemed">
        <a href="javascript:;">默认展开</a>
        <dl class="layui-nav-child">
            <dd><a href="javascript:;">选项一</a></dd>
            <dd><a href="javascript:;">选项二</a></dd>
            <dd><a href="javascript:;">选项三</a></dd>
            <dd><a href="">跳转项</a></dd>
        </dl>
    </li>
    <li class="layui-nav-item">
        <a href="javascript:;">解决方案</a>
        <dl class="layui-nav-child">
            <dd><a href="">移动模块</a></dd>
            <dd><a href="">后台模版</a></dd>
            <dd><a href="">电商平台</a></dd>
        </dl>
    </li>
    <li class="layui-nav-item"><a href="">云市场</a></li>
    <li class="layui-nav-item"><a href="">社区</a></li>
</ul>


<table class="layui-hide" id="test" lay-filter="test3"></table>

<script type="text/javascript">


    infoOptions = {
        elem: '#test',
        limits: [10],
        cellMinWidth: 80, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        cols: [
            [
                {field: 'hq', title: '编号', width: 120}
                , {field: 'cpName', title: '群名', width: 250}
                , {field: 'text', title: '问题', width: 500, edit: 'text'}
                , {field: 'admin', title: '时间', width: 140,}
                , {field: 'engineer', title: '员工', width: 100}
            ]
        ],
        data: []
    };
    let options = {
        type: "problem",
        status: "0",
        engineer_id: "all_engineer",
        cp_id: "",
        cp_name: "",
        hq: "",
        time: "0",
        endTime: '0'
    }

    $.ajax({
        url: "/ask_all_message"
        ,
        type: "get"
        ,
        data: {
            data: JSON.stringify(options)
        }
        ,
        dataType: "json"
        ,
        contentType: "application/json;charset=utf-8"
        ,
        success: function (data) {
            addMessage(data);
        }
    })

    function addMessage(data) {
        infoOptions.data = data;

        console.log(data)
        layui.use('table', function () {
            let table = layui.table;
            console.log(infoOptions);
            table.render(infoOptions);
        });
    }

</script>
<script th:src="@{/layui/jquery-3.6.0.min.js}"></script>
<script th:src="@{/layui/layui.js}"></script>




</body>
</html>